import request from '@/utils/request';

// 生产计划列表
export function planList(query) {
    return request({
        url: '/system/productPlan/list',
        method: 'get',
        params: query
    })
}

// udi生产计划列表
export function udiPlanList(query) {
    return request({
        url: '/system/productPlan/listPlan',
        method: 'get',
        params: query
    })
}

// 生产计划详细信息
export function planDetail(Id) {
    return request({
        url: '/system/productPlan/getInfo?id=' + Id,
        method: 'get'
    })
}

// 新建产品计划
export function planAdd(data) {
    return request({
        url: '/system/productPlan/add',
        method: 'post',
        data: data
    })
}

// 编辑产品计划
export function planEdit(data) {
    return request({
        url: '/system/productPlan/edit',
        method: 'post',
        data: data
    })
}

// 删除产品计划
export function planDelete(id) {
    return request({
        url: '/system/productPlan/remove?id=' + id,
        method: 'post'
    })
}

// 审核
export function planApprove(id, approveStatus, oldApproveStatus, approveRemark) {
    const data = {
        id,
        approveStatus,
        oldApproveStatus,
        approveRemark
    }
    return request({
        url: '/system/productPlan/approvePlun',
        method: 'post',
        data: data
    })
}
// 批量审核
export function planAllApprove(ids, approveStatus, approveRemark) {
    const data = {
        ids,
        approveStatus,
        approveRemark
    }
    return request({
        url: '/system/productPlan/approveAllPlan',
        method: 'post',
        data: data
    })
}

// 查询产品列表
export function productList(query) {
    return request({
        url: '/system/product/list',
        method: 'get',
        params: query
    })
}

// 查询所有产品规格
export function allSkuList(query) {
    return request({
        url: '/system/productPlan/sendDataList',
        method: 'get',
        params: query
    })
}

// 新产品接口
export function getProductList(query) {
    return request({
        url: '/system/productBasicInformation/getProductList',
        method: 'get',
        params: query
    })
}

// 根据产品查询规格
export function getSpecifications(query) {
    return request({
        url: '/system/productBasicInformation/getSpecifications',
        method: 'get',
        params: query
    })
}
